import axios from './network'
//    注册登录接口
function getTestingCode(phone){
  return axios({
    url:'servicer/login',
    data:{
      telephone: phone
    },
    method: "POST"
  })
}
//    注册登录接口
function sendTestingCode(code){
  return axios({
    url:'servicer/check',
    method:'POST',
    data:{
      code
    }
  })
}

function sendUserLogin(data){
  return axios({
    url:"servicer/password_login",
    method:"POST",
    data
  })
}

//    获得业务员查看业绩
function getSalesmanAchi(data){
  return axios({
    url:'servicer/performan',
    method:"POST",
    data
  })
}

//   获得业务员业绩图表
function getSalesmanTable(){
  return axios({
    url:"servicer/performan_map"
  })
}

//    获得客户查看业绩
function getClientAchi(data){
  return axios({
    url:'customer/performan',
    method:"POST",
    data
  })
}

//    获得预期提醒列表
function getWarnList(){
  return axios({
    url:'orders/overdue'
  })
}

//     获得预期提醒详情
function getWarnDetail(order_id){
  return axios({
    url:"orders/overdue_detail",
    data:{
      order_id
    }
  })
}

//   提交未付款原因
function sendPayCause(data){
  return axios({
    url:'orders/overdue_reason',
    method:"POST",
    data
  })
}
//   获得全部预期提醒
function getAlertCode(){
  return axios({
    url:'orders/alert_code'
  })
}

//    发送预期提醒
function sendWarn(order_id){
  return axios({
    url:'orders/overdue_alert',
    method:"POST",
    data:{
      order_id
    }
  })
}

//     修改资料
function sendChangeData(data){
  return axios({
    url:'servicer/servicer_edite',
    method:'POST',
    data
  })
}


export{
  getTestingCode,
  sendTestingCode,
  sendUserLogin,
  getWarnList,
  sendPayCause,
  sendWarn,
  getSalesmanAchi,
  getAlertCode,
  getSalesmanTable,
  getClientAchi,
  getWarnDetail,
  sendChangeData
}